/**
 * @file aicl_init_001.cpp
 *
 * Copyright (c) Huawei Technologies Co., Ltd. 2012-2018. All rights reserved.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */
#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <stdio.h>
#include <math.h>
#include <ctime>
#include <chrono>
#include "acl/acl.h"
#include "aicl.h"
#include "utils.h"

int main()
{
    const char *workPath = getenv("OPENCANN_TPATH");
    if (workPath == NULL) {
        ERROR_LOG("OPENCANN_TPATH is not set");
        return OPENCANN_FAILED;
    }
    std::string configPath = workPath;
    configPath += "/common/test_data/config/init_config.json";
    // aiclInit
    aiclRet ret;
    ret = aiclInit(configPath.c_str());
    if (ret != AICL_RET_SUCCESS) {
        ERROR_LOG("aiclInit failed");
        return OPENCANN_FAILED;
    } else {
        INFO_LOG("aiclInit success");
    }

    ret = aiclFinalize();
    if (ret != AICL_RET_SUCCESS) {
        ERROR_LOG("aiclFinalize failed");
        return OPENCANN_FAILED;
    } else {
        INFO_LOG("aiclFinalize success");
    }
 
    return OPENCANN_SUCCESS;
}
